//
//  DSZDSHViewController.m
//  7.13苏宁框架
//
//  Created by app05 on 15/7/25.
//  Copyright (c) 2015年 lovena. All rights reserved.
//

#import "DSZDSHViewController.h"
#import "DSZMoreView.h"

#import "DSZMainViewController.h"
#import "HomeViewController.h"
#import "DSZShopViewController.h"

@interface DSZDSHViewController ()<tableViewIndexPathRowDelegate>
@property(nonatomic,weak)UIView *moreView;
@property(nonatomic,assign)BOOL flag;
@end

@implementation DSZDSHViewController

-(void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.alpha=0;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)back {
    //DSZMainHeaderView *main=[[DSZMainHeaderView alloc]init];
    [self.navigationController popViewControllerAnimated:YES];
    
}
- (IBAction)more {
    if (!self.flag) {
        DSZMoreView *more=[DSZMoreView moreView];
        more.delegate=self;
        more.frame=CGRectMake(185, 65, 146, 186);
        self.moreView=more;
        [self.view addSubview:self.moreView];
        self.flag=YES;
    }
    else
    {
        [self.moreView removeFromSuperview];
        self.moreView=nil;
        self.flag=NO;
    }
    
}
-(void)dszMoreViewWithIndexRow:(NSInteger)indexPathRow
{
    if (indexPathRow==0) {
        UIStoryboard *story=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
        DSZMainViewController *main=[story instantiateViewControllerWithIdentifier:@"main"];
        //DSZMainViewController *main=[[DSZMainViewController alloc]init];
        [self presentViewController: main animated:NO completion:nil];
    }else if (indexPathRow==1)
    {}
    else if (indexPathRow==2)
    {
        UIStoryboard *story=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
        
        DSZShopViewController *shop=[story instantiateViewControllerWithIdentifier:@"shop"];
        [self.navigationController pushViewController:shop animated:NO];
        self.flag=YES;
        [self more];
        self.navigationController.navigationBar.alpha=1;
        DSZMainViewController *main=(DSZMainViewController*)self.tabBarController;
        [main hiddenMainTabbar:YES];
    }else if (indexPathRow==3)
    {
        [self.navigationController popToRootViewControllerAnimated:YES];
        
    }
    
}
@end
